<template>
<div id="mains">
    <header-tab title="漫画"/>
    <footer-tab/>

    <div id="contents">
        <!-- 漫画轮播 -->
        <my-swiper :key="carouselList.length">
            <div class="swiper-slide cartoonCarousel-item" v-for="item in carouselList" :key="item.banner_articleid">
                <img :src="item.banner_img_url" :alt="item.banner_title">
            </div>
        </my-swiper>

        <div style="padding: 30px;text-align:center;">
            <h3>Cartoon pages</h3>
            <h3>Cartoon pages</h3>
            <h3>Cartoon pages</h3>
            <h3>Cartoon pages</h3>

            <h3>Cartoon pages</h3>
            <h3>Cartoon pages</h3>
            <h3>Cartoon pages</h3>
            <h3>Cartoon pages - 1</h3>
            <h3>Cartoon pages</h3>
            <h3>Cartoon pages</h3>

            <h3>Cartoon pages</h3>
            <h3>Cartoon pages</h3>
            <h3>Cartoon pages</h3>

            <h3>Cartoon pages</h3>
            <h3>Cartoon pages</h3>
            <h3>Cartoon pages</h3>

            <h3>Cartoon pages</h3>
            <h3>Cartoon pages</h3>
            <h3>Cartoon pages</h3>

            <h3>Cartoon pages</h3>
            <h3>Cartoon pages</h3>
            <h3>Cartoon pages</h3>

            <h3>Cartoon pages</h3>
            <h3>Cartoon pages</h3>
            <h3>Cartoon pages - 18</h3>
            <h3>Cartoon pages - 1</h3>
            <h3>Cartoon pages</h3>
            <h3>Cartoon pages</h3>

            <h3>Cartoon pages</h3>
            <h3>Cartoon pages</h3>
            <h3>Cartoon pages</h3>

            <h3>Cartoon pages</h3>
            <h3>Cartoon pages</h3>
            <h3>Cartoon pages</h3>			
        </div>
    </div>
</div>
</template>

<script>
import { mapState } from 'vuex'
const HeaderTab = () => import("@/components/HeaderTab")
const FooterTab = () => import("@/components/FooterTab")
const MySwiper = () => import("@/components/Swiper")
export default {
    name: "cartoon",
    components: {
        MySwiper,
        HeaderTab,
        FooterTab,
    },
	mounted() {
        this.getCartoonCarouselList();
	},
	methods: {
        // 获取漫画轮播
		getCartoonCarouselList() {
            if(this.$store.state.cartoon.carouselList.length === 0) {
                this.$store.dispatch("cartoon/getCarouselList")
            } else {
                console.log("Cartoon - 使用缓存数据");
            }
		}
    },
    computed: {
        ...mapState("cartoon", ["carouselList"])
    },
}
</script>

<style scoped>
#contents {
    margin-bottom: 0;
    box-shadow: 0 -5px 10px #bfbfbf;
}
#contents .cartoonCarousel-item>img {
    width: 100%;
    height: 100%;
}
</style>